import axios from '@/utils/request'

export const getDepartmentList = () => {
  return axios.get('/company/department')
}

// 获取负责任列表
export const getDepartmentHeadUserList = () => {
  return axios.get('/sys/user/simple')
}

// 新增部门
export const addDepartment = (data) => {
  return axios({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取部门详情
export const getTreeNodeDetail = id => {
  return axios({
    url: `/company/department/${id}`
  })
}

// 更新部门
export const updateDepartment = data => {
  return axios({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

// 删除部门
export const delDepartment = id => {
  return axios({
    url: `/company/department/${id}`,
    method: 'delete'

  })
}
